<template>
  <div class="demo-spin-article">
    <Spin fix :show="show_spin" size="large"> </Spin>
    <div
      style="height: 100vh; width: auto; overflow-y: auto; margin: 20px 10px"
    >
      <template v-for="(url, i) in verticalUrlList" :key="i">
        <Image :src="url" lazy preview :preview-list="verticalUrlList" />
      </template>
    </div>
  </div>
</template>

<script>
import { PATH_Coreliteracy_file, aliyun_oss_path } from '@/mylibs/define'
import get_oss_data from '@/api/aliyun_oss'
import eventBus from '@/eventBus/eventBus'
export default {
  name: 'Coreliteracy',
  data() {
    return {
      show_spin: false,
      verticalUrlList: [],
      clientHeight: 600
    }
  },

  methods: {
    async getlist() {
      this.show_spin = true
      var { res, ok, err } = await get_oss_data(
        aliyun_oss_path + PATH_Coreliteracy_file
      )

      this.show_spin = false
      if (ok) {
        if (res) {
          this.verticalUrlList = res
        }
      } else {
        this.$Notice.error({ desc: '获取数据失败:' + err })
      }
    }
  },

  created() {
    this.getlist()

    eventBus.on('ev_screen_width_height', ({ w, h }) => {
      this.clientHeight = h
    })
  },

  activated() {
    eventBus.on('ev_screen_width_height', ({ w, h }) => {
      this.clientHeight = h
    })
  }
}
</script>

<style scoped></style>
